function [] = Simulation()
Constantes;
positionAvion = positionInitialeAvion;

figure();
Draw(positionAvion,positionObs);


t0 = cputime;
[tr(1),frMod(1),powerLoss(1)] = getReceptionInformation(t0,positionAvion,positionObs,vitesseAvion);
recu(1) = 0;

while(positionAvion(1) < 20000)
    
    tc = cputime;
    D1courant = floor((tc - t0));
    
    while floor((tc - t0)) == D1courant
        display(tc - t0);
        tc = cputime;
        D2courant = floor(((tc - t0) * 10000) / (pasT * 10000));
        
        while(floor((tc - t0) * 10000 / (pasT * 10000)) == D2courant)
            tc = cputime;
        end
        
        for i = 1:length(tr)
            if tc > tr(i) && recu(i) == 0
                emettreSon(frMod(i),powerLoss(i));
                recu(i) = 1;
            end
        end
        
        positionAvion = positionInitialeAvion + vitesseAvion * (tc - t0);
        Draw(positionAvion,positionObs);
    end
    
    k = length(tr) + 1;
    recu(k) = 0;
    [tr(k),frMod(k),powerLoss(k)] = getReceptionInformation(tc,positionAvion,positionObs,vitesseAvion);
    
end

figure();
plot(tr - t0 * ones(size(tr)),frMod);
figure();
plot(tr - t0 * ones(size(tr)),powerLoss);

end